package com.neusoft.yuejian12.yuejian_12.model;

import com.neusoft.yuejian12.yuejian_12.javabean.ClubBean;
import com.neusoft.yuejian12.yuejian_12.service.ClubService;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import static com.neusoft.yuejian12.yuejian_12.model.BaseModel.BASE_URL;


/**
 * Created by Administrator on 2017/9/27.
 */

public class ClubModel{
    private Retrofit retrofit;
    public ClubModel(){
        //创建实例
        retrofit =new Retrofit.Builder()
                .baseUrl(BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    //俱乐部列表
    public Call<List<ClubBean>> getClublist(){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getClublist();
    }

    //俱乐部详情
    public Call<ClubBean> getClubinfo(int c_id){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getClubinfo(c_id);
    }


}
